import axios from '&helpers/axios'

export const reqAddSudent = (params) => {
  return axios({
    url: '/student/add',
    method: 'post',
    params: params
  })
}


export const reqFetchList = (params) => {
  return axios({
    url: '/student/list',
    method: 'get',
    params: params
  })
}


export const reqUpdateStudent = (params) => {
  params.grade = localStorage.getItem("grade")
  
  return axios({
    url: "/student/update",
    method: 'post',
    params: params
  })
}

export const reqUploadFile = (params) => {
  const formData = new FormData()
  for(let prop in params){
  formData.append(prop,params[prop])
  }
  return axios({
    url: "/student/upload",
    method: 'post',
    data: formData
  })
}